<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover" />
    <title>通讯录</title>
    <link rel="stylesheet" href="{{asset('/addons/jquery-weui-build/css/weui.min.css')}}">
    <link rel="stylesheet" href="{{asset('/addons/jquery-weui-build/css/jquery-weui.css')}}">
    <link rel="stylesheet" href="{{asset('/css/system/iconfont.css')}}">
    @if($skinid == 3)
        <link rel="stylesheet" href="/css/system/common.css">
        <link rel="stylesheet" href="{{assethelp('/css/system/main-list.css?v='.time())}}">
    @elseif($skinid == 1)
        <link rel="stylesheet" href="/css/theme-blue/system/common.css">
        <link rel="stylesheet" href="/css/theme-blue/system/main-list.css">
    @elseif($skinid == 2)
        <link rel="stylesheet" href="/css/theme-pink/system/iconfont-pink.css">
        <link rel="stylesheet" href="/css/theme-pink/system/common.css">
        <link rel="stylesheet" href="/css/theme-pink/system/main-list.css">
    @endif
    @include('sysadmin.head')
</head>
<body ontouchstart>
<div class="mian-container">
    <div class="main-list">
       <div class="list-input">
        <div class="weui-search-bar" id="searchBar">
            <form class="weui-search-bar__form" action="" method="get" id="name-search">
                <div class="weui-search-bar__box">
                    <i class="weui-icon-search start-search"></i>
                    <input type="search" name="name" class="weui-search-bar__input" id="searchInput" placeholder="" required="">
                    <a href="javascript:" class="weui-icon-clear" id="searchClear"></a>
                </div>
                <label class="weui-search-bar__label" id="searchText">
                    <i class="weui-icon-search"></i>
                </label>
            </form>
        <a href="javascript:" class="weui-search-bar__cancel-btn" id="searchCancel">取消</a>
        </div>
        <a class="add-link" href="javascript:void(0);"><i class="icon iconfont icon-hao"></i></a>
        <i class="icon iconfont icon-sanjiaoshang icon-san"></i>
        <div class="hidden-add">
           {{-- <a href="javascript:void(0);"><i class="icon iconfont icon-chengyuan"></i>创建同事</a>--}}
            <a href="{{url('/sysadmin/group/index')}}"><i class="icon iconfont icon-bumen1"></i>部门管理</a>
        </div>
       </div>
       <div class="center-list">
           @foreach($tongxunlu as $t)
               <div class="section-list">
                   <h3 class="h3-title">
                       @if($t['group_name'] != '我的同事')
                           <img class="con-img" src="{{asset('/img/list-user1.png')}}">
                       @endif{{$t['group_name']}}
                   </h3>
                   <span class="num-span"></span>
                   <ul>
                       @foreach($t['member'] as $m)
                           @if($m['is_leader'] == 1)
                               <li>
                                   <img class="sec-img" src="{{userlogo($m['id'])}}">
                                   <span class="sec-name" onclick="window.location.href='/sysadmin/user/index?userid={{$m['id']}}'">{{$m['qw_name']}}</span>
                                   @if($m['is_leader'] == 1)<i class="icon iconfont icon-qizi"></i>@endif
                                   @foreach($m['role'] as $mr)
                                       <span class="circle-span @if($mr==10) span-exam @elseif($mr==11) span-score @elseif($mr==12) span-reward @elseif($mr==9) span-total @endif">{{$rolearray[$mr]}}</span>
                                   @endforeach
                                   @if($m['is_sales'] == 1)
                                       <span class="circle-span span-sell">销</span>
                                   @endif
                               </li>
                           @endif
                       @endforeach
                       @foreach($t['member'] as $m)
                           @if($m['is_leader'] != 1)
                                   <li>
                                       <img class="sec-img" src="{{userlogo($m['id'])}}">
                                       <span class="sec-name" onclick="window.location.href='/sysadmin/user/index?userid={{$m['id']}}'">{{$m['qw_name']}}</span>
                                       @if($m['is_leader'] == 1)<i class="icon iconfont icon-qizi"></i>@endif
                                       @foreach($m['role'] as $mr)
                                           <span class="circle-span @if($mr==10) span-exam @elseif($mr==11) span-score @elseif($mr==12) span-reward @elseif($mr==9) span-total @endif">{{$rolearray[$mr]}}</span>
                                       @endforeach
                                       @if($m['is_sales'] == 1)
                                           <span class="circle-span span-sell">销</span>
                                       @endif
                                   </li>
                           @endif
                       @endforeach
                   </ul>
                   @if(isset($t['child']))
                       @foreach($t['child'] as $c)
                           <div class="second-list">
                               <h3 class="h3-title"><img class="con-img" src="{{asset('/img/list-user1.png')}}">{{$c['group_name']}}</h3>
                               <span class="num-span"></span>
                               <ul>
                                   @foreach($c['member'] as $cm)
                                       @if($cm['is_leader'] == 1)
                                           <li>
                                               <img class="sec-img" src="{{userlogo($cm['id'])}}">
                                               <span class="sec-name" onclick="window.location.href='/sysadmin/user/index?userid={{$cm['id']}}'">{{$cm['qw_name']}}</span>
                                               @if($cm['is_leader'] == 1)<i class="icon iconfont icon-qizi"></i>@endif
                                               @foreach($cm['role'] as $cmr)
                                                   <span class="circle-span @if($cmr==10) span-exam @elseif($cmr==11) span-score @elseif($cmr==12) span-reward @elseif($cmr==9) span-total @endif">{{$rolearray[$cmr]}}</span>
                                               @endforeach
                                               @if($cm['is_sales'] == 1)
                                                   <span class="circle-span span-sell">销</span>
                                               @endif
                                           </li>
                                       @endif
                                   @endforeach
                                   @foreach($c['member'] as $cm)
                                           @if($cm['is_leader'] != 1)
                                               <li>
                                                   <img class="sec-img" src="{{userlogo($cm['id'])}}">
                                                   <span class="sec-name" onclick="window.location.href='/sysadmin/user/index?userid={{$cm['id']}}'">{{$cm['qw_name']}}</span>
                                                   @if($cm['is_leader'] == 1)<i class="icon iconfont icon-qizi"></i>@endif
                                                   @foreach($cm['role'] as $cmr)
                                                       <span class="circle-span @if($cmr==10) span-exam @elseif($cmr==11) span-score @elseif($cmr==12) span-reward @elseif($cmr==9) span-total @endif">{{$rolearray[$cmr]}}</span>
                                                   @endforeach
                                                   @if($cm['is_sales'] == 1)
                                                       <span class="circle-span span-sell">销</span>
                                                   @endif
                                               </li>
                                           @endif
                                   @endforeach
                               </ul>
                               @foreach($c['child'] as $cc)
                                   <div class="third-list">
                                       <h3 class="h3-title"><img class="con-img" src="{{asset('/img/list-user1.png')}}">{{$cc['group_name']}}</h3>
                                       <span class="num-span"></span>
                                       <ul>
                                           @foreach($cc['member'] as $ccm)
                                               @if($ccm['is_leader'] == 1)
                                                   <li>
                                                       <img class="sec-img" src="{{userlogo($ccm['id'])}}">
                                                       <span class="sec-name" onclick="window.location.href='/sysadmin/user/index?userid={{$ccm['id']}}'">{{$ccm['qw_name']}}</span>
                                                       @if($ccm['is_leader'] == 1)<i class="icon iconfont icon-qizi"></i>@endif
                                                       @foreach($ccm['role'] as $ccmr)
                                                           <span class="circle-span @if($ccmr==10) span-exam @elseif($ccmr==11) span-score @elseif($ccmr==12) span-reward @elseif($ccmr==9) span-total @endif">{{$rolearray[$ccmr]}}</span>
                                                       @endforeach
                                                       @if($ccm['is_sales'] == 1)
                                                           <span class="circle-span span-sell">销</span>
                                                       @endif
                                                   </li>
                                               @endif
                                           @endforeach
                                           @foreach($cc['member'] as $ccm)
                                                   @if($ccm['is_leader'] != 1)
                                                       <li>
                                                           <img class="sec-img" src="{{userlogo($ccm['id'])}}">
                                                           <span class="sec-name" onclick="window.location.href='/sysadmin/user/index?userid={{$ccm['id']}}'">{{$ccm['qw_name']}}</span>
                                                           @if($ccm['is_leader'] == 1)<i class="icon iconfont icon-qizi"></i>@endif
                                                           @foreach($ccm['role'] as $ccmr)
                                                               <span class="circle-span @if($ccmr==10) span-exam @elseif($ccmr==11) span-score @elseif($ccmr==12) span-reward @elseif($ccmr==9) span-total @endif">{{$rolearray[$ccmr]}}</span>
                                                           @endforeach
                                                           @if($ccm['is_sales'] == 1)
                                                               <span class="circle-span span-sell">销</span>
                                                           @endif
                                                       </li>
                                                   @endif
                                           @endforeach
                                       </ul>
                                   </div>
                               @endforeach
                           </div>
                       @endforeach
                   @endif
               </div>
           @endforeach
       </div>
    </div>
    <!--阴影遮罩-->
    <div class="list-shadow"></div>
    <!-- 隐藏考核按钮部分-->
    @include('sysadmin.admin-caidan')
</div>
<script src="{{asset('/kaohe/js/jquery-2.1.4.min.js')}}"></script>
<script src="{{asset('/addons/jquery-weui-build/js/fastclick.js')}}"></script>
<script>
    $(function() {
        document.documentElement.style.fontSize = document.documentElement.clientWidth / 7.5 + 'px';
        FastClick.attach(document.body);
    });
</script>
<script src="{{asset('/addons/jquery-weui-build/js/jquery-weui.min.js')}}"></script>
<script>
    $(document).ready(function () {
        $('.num-span').each(function(){
            $(this).text($(this).next('ul').children().length);
        });
        $('.h3-title').click(function(){
            $(this).toggleClass('ah3-title');           
            $(this).siblings('ul').toggle();
        });
        $('.add-link').click(function(){
            $('.list-shadow').toggle();
            $('.hidden-add').toggle();
            $('.icon-san').toggle();
        });
         $('.kaohe-item').click(function(){
            $('.show-hidden').toggle();
        })
        $('.admin-item').click(function(){
            $('.front-show-hidden').toggle();
        });

        $('.start-search').click(function(){
            $('#name-search').submit();
        });

        var geturl = window.location.href;
        if(geturl.indexOf("name") >= 0){
            $('.h3-title').trigger('click');
        }
    })
</script>
</body>
</html>